home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / dispms / dispmsg.frm < prev    next >
Text File  |  1995-05-08  |  6KB  |  203 lines

  1. VERSION 2.00
  2. Begin Form DispMsg 
  3.    Caption         =   "Display Message"
  4.    ClientHeight    =   4170
  5.    ClientLeft      =   2655
  6.    ClientTop       =   1740
  7.    ClientWidth     =   3810
  8.    Height          =   4575
  9.    Icon            =   DISPMSG.FRX:0000
  10.    Left            =   2595
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   4170
  13.    ScaleWidth      =   3810
  14.    Tag             =   "Display Message (c) 1994 Rufan Redi Productions"
  15.    Top             =   1395
  16.    Width           =   3930
  17.    Begin CommandButton Command3 
  18.       Caption         =   "&What's the time ?"
  19.       Height          =   315
  20.       Left            =   120
  21.       TabIndex        =   11
  22.       Top             =   1020
  23.       Width           =   1695
  24.    End
  25.    Begin HScrollBar HScroll1 
  26.       Height          =   255
  27.       Left            =   2040
  28.       Max             =   999
  29.       TabIndex        =   9
  30.       Tag             =   "This is a slider bar"
  31.       Top             =   1320
  32.       Width           =   1515
  33.    End
  34.    Begin CommandButton Command2 
  35.       Caption         =   "&See the Author !"
  36.       Height          =   375
  37.       Left            =   120
  38.       TabIndex        =   8
  39.       Tag             =   "For an introduction to the author ..."
  40.       Top             =   1380
  41.       Width           =   1695
  42.    End
  43.    Begin PictureBox Picture1 
  44.       Height          =   1815
  45.       Left            =   60
  46.       Picture         =   DISPMSG.FRX:0302
  47.       ScaleHeight     =   1785
  48.       ScaleWidth      =   2865
  49.       TabIndex        =   7
  50.       Tag             =   "This is a little bit of a space man !"
  51.       Top             =   1860
  52.       Width           =   2895
  53.    End
  54.    Begin ComboBox Combo1 
  55.       Height          =   300
  56.       Left            =   1860
  57.       TabIndex        =   6
  58.       Tag             =   "Drop this down to see a list of things"
  59.       Text            =   "Drop me down !"
  60.       Top             =   840
  61.       Width           =   1875
  62.    End
  63.    Begin CommandButton Command1 
  64.       Caption         =   "&Hello"
  65.       Default         =   -1  'True
  66.       Height          =   495
  67.       Left            =   120
  68.       TabIndex        =   5
  69.       Tag             =   "Push here to say Hello"
  70.       Top             =   480
  71.       Width           =   1695
  72.    End
  73.    Begin OptionButton Option1 
  74.       Caption         =   "Option Two"
  75.       Height          =   315
  76.       Index           =   1
  77.       Left            =   1980
  78.       TabIndex        =   4
  79.       Tag             =   "Clich here to set the second option"
  80.       Top             =   420
  81.       Width           =   1335
  82.    End
  83.    Begin OptionButton Option1 
  84.       Caption         =   "Option One"
  85.       Height          =   315
  86.       Index           =   0
  87.       Left            =   1980
  88.       TabIndex        =   3
  89.       Tag             =   "Click on this line to chose the first option"
  90.       Top             =   60
  91.       Value           =   -1  'True
  92.       Width           =   1335
  93.    End
  94.    Begin CheckBox Check1 
  95.       Caption         =   "A Check Box"
  96.       Height          =   375
  97.       Left            =   240
  98.       TabIndex        =   2
  99.       Tag             =   "Click here to set the check-box"
  100.       Top             =   60
  101.       Width           =   1635
  102.    End
  103.    Begin CommandButton Exit 
  104.       Cancel          =   -1  'True
  105.       Caption         =   "E&xit"
  106.       Height          =   495
  107.       Left            =   3060
  108.       TabIndex        =   1
  109.       Tag             =   "This button exits the demo form"
  110.       Top             =   3240
  111.       Width           =   675
  112.    End
  113.    Begin Timer MessageTimer 
  114.       Enabled         =   0   'False
  115.       Interval        =   250
  116.       Left            =   3180
  117.       Top             =   1920
  118.    End
  119.    Begin Label Label1 
  120.       Caption         =   "Slider value"
  121.       Height          =   195
  122.       Left            =   2400
  123.       TabIndex        =   10
  124.       Tag             =   "Shows the slider bar value"
  125.       Top             =   1620
  126.       Width           =   1035
  127.    End
  128.    Begin Label Message 
  129.       BorderStyle     =   1  'Fixed Single
  130.       Height          =   255
  131.       Left            =   0
  132.       TabIndex        =   0
  133.       Top             =   3900
  134.       Width           =   7335
  135.    End
  136. End
  137. Sub Check1_Click ()
  138. ' Example of a quick information message
  139.   If Check1.Value Then
  140.     Message.Caption = "I've just been set"
  141.   Else
  142.     Message.Caption = "I've just been cleared"
  143.   End If
  144. End Sub
  145.  
  146. Sub Command1_Click ()
  147.   MsgBox "Hello !" + Chr$(13) + "Welcome to the DisplayMessage Demo." + Chr$(13) + "Please review the ReadMe procedure in DispMsg.Bas", , "Display Message"
  148. End Sub
  149.  
  150. Sub Command2_Click ()
  151. ' As you can see - it is possible to manually change the message as well
  152.   Message.Caption = "Double click to close this picture..."
  153.   Jeremy.Show
  154. End Sub
  155.  
  156. Sub Command3_Click ()
  157.   Command3.Tag = "This button was last clicked at " + Time$
  158. End Sub
  159.  
  160. Sub Exit_Click ()
  161.   End
  162. End Sub
  163.  
  164. Sub Form_Activate ()
  165.   MessageTimer.Enabled = True
  166. End Sub
  167.  
  168. Sub Form_Deactivate ()
  169.   MessageTimer.Enabled = False
  170. End Sub
  171.  
  172. Sub Form_Load ()
  173.   Combo1.AddItem "Item One"
  174.   Combo1.AddItem "Another Item"
  175.   Combo1.AddItem "This is Item Three"
  176.   Combo1.AddItem "Four Items is enough !"
  177. End Sub
  178.  
  179. Sub Form_Resize ()
  180.   ' Find the size of the Windows Client area
  181.   Call GetClientRect(DispMsg.hWnd, lpRect)
  182.   ' Set the width of the message to equal the window
  183.   Message.Width = lpRect.Width * Screen.TwipsPerPixelX
  184.   ' And make sure that the box is always the same distance from the bottom
  185.   Message.Top = (lpRect.Height * Screen.TwipsPerPixelY) - Message.Height
  186. End Sub
  187.  
  188. Sub HScroll1_Change ()
  189.   Label1.Caption = "Slider:" + Str$(HScroll1.Value)
  190.   ' This demonstrates dynamically changing the slider value
  191.   Label1.Tag = "Slider value set to" + Str$(HScroll1.Value)
  192. End Sub
  193.  
  194. Sub MessageTimer_Timer ()
  195.   Call DisplayMessage(DispMsg)
  196. End Sub
  197.  
  198. Sub Option1_Click (Index As Integer)
  199. ' A quick information message
  200.   Message.Caption = "Option" + Str$(Index + 1) + " has been set"
  201. End Sub
  202.  
  203.